package com.hm.hall.commons.dao;

import com.hm.hall.commons.domain.AppVersionExample;
import com.hm.hall.commons.domain.AppVersion;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AppVersionMapper {
    int countByExample(AppVersionExample example);

    int deleteByExample(AppVersionExample example);

    int deleteByPrimaryKey(Long id);

    int insert(AppVersion record);

    int insertSelective(AppVersion record);

    int insertSelectiveGetKey(AppVersion record);

    List<AppVersion> selectByExample(AppVersionExample example);

    AppVersion selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") AppVersion record, @Param("example") AppVersionExample example);

    int updateByExample(@Param("record") AppVersion record, @Param("example") AppVersionExample example);

    int updateByPrimaryKeySelective(AppVersion record);

    int updateByPrimaryKey(AppVersion record);

    @Select("SELECT * from t_app_version where lang = #{lang} AND update_platform = #{deviceType} AND status =0 order by id desc limit 1")
    AppVersion getNewestVersionByChName(@Param("lang") String lang, @Param("deviceType") Integer deviceType);
}